# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj -o - \
# RUN:   | extract-section .text \
# RUN:   | FileCheck %s -check-prefixes=MOV8JK,MOV32JK,MOV8JQ,MOV32JQ,MOV8FF,MOV32FF
# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj -o - \
# RUN:   | extract-section .text \
# RUN:   | FileCheck %s -check-prefixes=MOV8PP,MOV32PP,MOV8JJ,MOV32JJ,MOV8OO,MOV32OO
# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj -o - \
# RUN:   | extract-section .text \
# RUN:   | FileCheck %s -check-prefixes=MOV8EE,MOV32EE,MOV8BB,MOV32BB

#------------------------------------------------------------------------------
# MxMove_MM is used for moving data from memory to memory
#------------------------------------------------------------------------------

--- # ARI <- PCI
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8JK:        0   0   0   1   0   0   0   0 . 1   0   1   1   1   0   1   1
# MOV8JK-SAME:   0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV8JK-SAME:   0   0   0   1   0   0   0   0 . 1   0   1   1   1   0   1   1
# MOV8JK-SAME:   0   0   0   1   1   0   0   0 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32JK-SAME:  0   0   1   0   0   0   0   0 . 1   0   1   1   1   0   1   1
# MOV32JK-SAME:  0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32JK-SAME:  0   0   1   0   0   0   1   0 . 1   0   1   1   1   0   1   1
# MOV32JK-SAME:  1   0   1   0   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---+-----------+---+-------+---+-------------------------------
#        BRIEF  DA |    REG    | L | SCALE | 0 |          DISPLACEMENT
#               ---+-----------+---+-------+---+-------------------------------
name: MxMove_RM_ARI_PCI
body: |
  bb.0:
    MOV8jk  $a0,  0, $d1, implicit-def $ccr
    MOV8jk  $a0, -1, $d1, implicit-def $ccr
    MOV32jk $a0,  0, $d1, implicit-def $ccr
    MOV32jk $a1,  0, $a2, implicit-def $ccr

...
--- # ARI <- PCD
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8JQ-SAME:   0   0   0   1   0   0   0   0 . 1   0   1   1   1   0   1   0
# MOV8JQ-SAME:   0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32JQ-SAME:  0   0   1   0   0   0   0   0 . 1   0   1   1   1   0   1   0
# MOV32JQ-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32JQ-SAME:  0   0   1   0   0   0   0   0 . 1   0   1   1   1   0   1   0
# MOV32JQ-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
name: MxMove_RM_PCD
body: |
  bb.0:
    MOV8jq  $a0,  0, implicit-def $ccr
    MOV32jq $a0, -1, implicit-def $ccr
    MOV32jq $a0, -1, implicit-def $ccr

...
--- # ARII <- ARII
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8FF:        0   0   0   1   0   0   0   1 . 1   0   1   1   0   0   0   0
# MOV8FF-SAME:   0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
# MOV8FF-SAME:   0   0   0   1   1   0   0   0 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV8FF-SAME:   0   0   0   1   0   0   0   1 . 1   0   1   1   0   0   0   0
# MOV8FF-SAME:   0   0   0   1   1   0   0   0 . 1   1   1   1   1   1   1   1
# MOV8FF-SAME:   0   0   0   1   1   0   0   0 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32FF-SAME:  0   0   1   0   0   0   1   1 . 1   0   1   1   0   0   0   1
# MOV32FF-SAME:  0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
# MOV32FF-SAME:  0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32FF-SAME:  0   0   1   0   0   1   0   1 . 1   0   1   1   0   0   1   0
# MOV32FF-SAME:  1   0   1   0   1   0   0   0 . 0   0   1   0   1   0   1   0
# MOV32FF-SAME:  1   0   1   0   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---+-----------+---+-------+---+-------------------------------
#        BRIEF  DA |    REG    | L | SCALE | 0 |          DISPLACEMENT
#               ---+-----------+---+-------+---+-------------------------------
name: MxMove_RM_ARII_ARII
body: |
  bb.0:
    MOV8ff  -1, $a0, $d1, 0,  $a0, $d1, implicit-def $ccr
    MOV8ff  -1, $a0, $d1, -1, $a0, $d1, implicit-def $ccr
    MOV32ff 0,  $a1, $d1, 0,  $a1, $d1, implicit-def $ccr
    MOV32ff 0,  $a2, $a2, 42, $a2, $a2, implicit-def $ccr

...
--- # ARID <- ARID
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8PP:        0   0   0   1   0   0   0   1 . 0   1   1   0   1   0   0   0
# MOV8PP-SAME:   0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
# MOV8PP-SAME:   0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32PP-SAME:  0   0   1   0   0   0   1   1 . 0   1   1   0   1   0   0   1
# MOV32PP-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
# MOV32PP-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32PP-SAME:  0   0   1   0   0   0   1   1 . 0   1   1   0   1   0   0   1
# MOV32PP-SAME:  0   0   0   0   0   0   0   0 . 0   0   1   0   1   0   1   0
# MOV32PP-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
name: MxMove_RM_ARID
body: |
  bb.0:
    MOV8pp   0, $a0, 0,  $a0, implicit-def $ccr
    MOV32pp  0, $a1, -1, $a1, implicit-def $ccr
    MOV32pp -1, $a1, 42, $a1, implicit-def $ccr

...
--- # ARIPD <- ARIPD
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8EE:        0   0   0   1   0   0   0   1 . 0   0   1   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32EE-SAME:  0   0   1   0   0   0   1   1 . 0   0   1   0   0   0   0   1
#               ---------------------------------------------------------------
# MOV32EE-SAME:  0   0   1   0   0   0   1   1 . 0   0   1   0   0   0   0   1
name: MxMove_RM_ARIPD
body: |
  bb.0:
    MOV8ee  $a0, $a0, implicit-def $ccr
    MOV32ee $a1, $a1, implicit-def $ccr
    MOV32ee $a1, $a1, implicit-def $ccr

...
--- # ARIPI <- ARIPI
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8OO-SAME:   0   0   0   1   0   0   0   0 . 1   1   0   1   1   0   0   0
#               ---------------------------------------------------------------
# MOV32OO-SAME:  0   0   1   0   0   0   1   0 . 1   1   0   1   1   0   0   1
#               ---------------------------------------------------------------
# MOV32OO-SAME:  0   0   1   0   0   0   1   0 . 1   1   0   1   1   0   0   1
name: MxMove_RM_ARIPI
body: |
  bb.0:
    MOV8oo  $a0, $a0, implicit-def $ccr
    MOV32oo $a1, $a1, implicit-def $ccr
    MOV32oo $a1, $a1, implicit-def $ccr

...
--- # ARI <- ARI
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8JJ-SAME:   0   0   0   1   0   0   0   0 . 1   0   0   1   0   0   0   0
#               ---------------------------------------------------------------
# MOV32JJ-SAME:  0   0   1   0   0   0   1   0 . 1   0   0   1   0   0   0   1
#               ---------------------------------------------------------------
# MOV32JJ-SAME:  0   0   1   0   0   0   1   0 . 1   0   0   1   0   0   0   1
name: MxMove_RM_ARI
body: |
  bb.0:
    MOV8jj  $a0, $a0, implicit-def $ccr
    MOV32jj $a1, $a1, implicit-def $ccr
    MOV32jj $a1, $a1, implicit-def $ccr

...
--- # ABS <- ABS
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8BB-SAME:   0   0   0   1   0   0   1   1 . 1   1   1   1   1   0   0   1
# MOV8BB-SAME:   1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
# MOV8BB-SAME:   0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32BB-SAME:  0   0   1   0   0   0   1   1 . 1   1   1   1   1   0   0   1
# MOV32BB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
# MOV32BB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
# MOV32BB-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
# MOV32BB-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32BB-SAME:  0   0   1   0   0   0   1   1 . 1   1   1   1   1   0   0   1
# MOV32BB-SAME:  0   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
# MOV32BB-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
# MOV32BB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
# MOV32BB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
name: MxMove_RM_ABS
body: |
  bb.0:
    MOV8bb   0, -1,          implicit-def $ccr
    MOV32bb -1,  0,          implicit-def $ccr
    MOV32bb  0,  2147483647, implicit-def $ccr

...
